<template>
    <div class="CashInstApplyItem">
        <el-row>
            <el-col :span="11" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">现金分期申请卡号:</span>
                        <span class="el-form-item-span">{{SUCCESSDATA.CARDNBR}}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="11" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">剩余可用额度:</span>
                        <span class="el-form-item-span">{{SUCCESSDATA.CALAVAL }}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="11" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">分期金额:</span>
                        <span class="el-form-item-span">{{SUCCESSDATA.MPAMT }}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="11" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">期数:</span>
                        <span class="el-form-item-span">{{SUCCESSDATA.NBRMTHS }}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="11" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">手续费率:</span>
                        <span class="el-form-item-span">{{SUCCESSDATA.rate|formatfee }}</span>
                    </div>
                </div>
            </el-col>

            <el-col :span="22" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <div class="text_span text_center">现金分期申请成功!</div>
                    </div>
                </div>
            </el-col>
        </el-row>
        <div class="text_center margin_top20">
            <el-button
                type="primary"
                size="small"
                @click="handleClose"
                icon="el-icon-circle-check"
            >确定</el-button>
            <el-button type="primary" size="small" @click="handleClickbtn">分期付款申请记录查询</el-button>
        </div>
    </div>
</template>

<script>
import { mapState } from 'vuex';
import { closePage, getBusinessMenuId } from '@/utils/Common';
export default {
    name: 'CashInstApplyItem',
    props: {
        SUCCESSDATA: {
            type: Object,
        },
    },
    data() {
        return { MenuId: '', };
    },
    // 取缓存信息
    computed: mapState({
        businessMenu: state => state.menu.businessMenu,
    }),
    filters: {
        // 申请转移的银行卡类型 -> 转译
        getTypeText(val, bankTypeList) {
            let text = '';
            bankTypeList.forEach((item) => {
                if (item.code === val) {
                    text = item.label;
                }
            });
            return text;
        },
        formatfee(val) {
            let txt = '';
            txt = parseFloat(val * 100).toFixed(2) + '%';
            return txt;
        },
    },
    methods: {
        // 点击关闭
        handleClose() {
            closePage(this.$route, this, 1);
        },
        handleClickbtn() {

            this.MenuId = getBusinessMenuId('/carPeriodic/mptransrecordqry', this.businessMenu);
            console.log('this.MenuId____', this.MenuId);
            this.$router.push({ name: 'mptransrecordqry', path: '/carPeriodic/mptransrecordqry', params: { id: this.MenuId } });
        }
    },
};
</script>
<style lang='scss'>
.CashInstApplyItem {
    .text_span {
        margin: 15px 20px;
        font-size: 16px;
    }
    .el-row .el-col {
        margin-bottom: 10px;
    }
    .text_center .el-form-item-span-wrap.el-form-item-span-label {
        padding: 15px 12px 0 0;
    }
    .text_fl {
        margin-bottom: 5px;
    }
}
</style>
